package com.example.controller;

import com.example.dao.ProductMapper;
import com.example.model.Product;
import com.example.model.Result;
import com.example.modelDTO.ProductDTO;
import com.example.service.impl.ProductServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Hello
 * @since 2024-07-09
 */
@RestController
@RequestMapping("/product")
public class ProductController {
    @Autowired
    ProductServiceImpl productService;

    @GetMapping("getAllListedProduct")
    public Result<List<ProductDTO>> getAllListedProducts(){
        return Result.success(productService.getAllListedProducts());
    }


    /*@PostMapping("getAllByRestaurantId")
    public Result<List<ProductDTO>> getAllByRestaurantId(@RequestBody HashMap<String,String> map){
        return Result.success(productService.getAllByRestaurantId(map.get("restaurantId")));
    }*/


}
